package com.gsnd.briuppts.exception;

import com.gsnd.briuppts.result.ResponseCode;
import lombok.Getter;

/**
 * @Description: 溯源项目中出现的异常总类
 * @Author: GX Cui
 * @Date 09:41 2024/6/23
 */
@Getter
public class PtsException extends RuntimeException{
    ResponseCode responseCode;

    public PtsException(){
        this("出现了一个不重要的小异常");
    }
    public PtsException(String msg){
        super(msg);
    }
    public PtsException(ResponseCode responseCode){
        super(responseCode.getCode()+"-"
                +responseCode.name()+":"
                +responseCode.getStatus());
        // 示例："200-ok:请求成功"
        this.responseCode = responseCode;
    }
}
